Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 8, 2025

The BaggageBuilder class docstring example used Python interactive prompt syntax (>>> and ...) with backslash continuations, which renders incorrectly in Sphinx-generated documentation on learn.microsoft.com.

Changes:

  • Convert example from interactive prompt format to RST .. code-block:: python directive
  • Replace backslash line continuations with parenthesized method chaining (more Pythonic)

Before:

>>> with BaggageBuilder() \
...     .tenant_id("tenant-123") \
...     .agent_id("agent-456") \
...     .correlation_id("corr-789") \
...     .build():
...     # Baggage is set in this context
...     pass

After:

.. code-block:: python

    builder = (BaggageBuilder()
               .tenant_id("tenant-123")
               .agent_id("agent-456")
               .correlation_id("corr-789"))

    with builder.build():
        # Baggage is set in this context
        pass
Original prompt

This section details on the original issue you should resolve

<issue_title>BaggageBuilder example is not correct</issue_title>
<issue_description>When viewing the BaggageBuilder class example in the learn.microsoft.com documentation here: BaggageBuilder Class the sample code looks like this:

>>> with BaggageBuilder()         ...     .tenant_id("tenant-123")         ...     .agent_id("agent-456")         ...     .correlation_id("corr-789")         ...     .build():
...     # Baggage is set in this context
...     pass
>>> # Baggage is restored after exiting the context

This doesn't look right. This sample comes from the code found in /libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/middleware/baggage_builder.py#L45-L54.

All the docstrings should be written in reStructuredText (RST) format.

Fix this so that the docs generated for learn.microsoft.com will be correct.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix incorrect BaggageBuilder example in documentation Fix BaggageBuilder docstring to use proper RST format Dec 8, 2025
Copilot AI requested a review from JimDaly December 8, 2025 23:12
Copy link
Member

@JimDaly JimDaly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@JimDaly JimDaly marked this pull request as ready for review December 9, 2025 16:18
@JimDaly JimDaly requested a review from a team as a code owner December 9, 2025 16:18
Copilot AI review requested due to automatic review settings December 9, 2025 16:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the BaggageBuilder class docstring to use proper RST formatting for Sphinx-generated documentation on learn.microsoft.com. The previous interactive Python prompt syntax (>>> and ...) with backslash continuations was rendering incorrectly in the published documentation.

Key changes:

  • Converted docstring example from interactive prompt format to RST .. code-block:: python directive
  • Replaced backslash line continuations with parenthesized method chaining (more Pythonic and clearer)

@JimDaly JimDaly merged commit d973242 into main Dec 9, 2025
18 checks passed
@JimDaly JimDaly deleted the copilot/fix-baggagebuilder-example branch December 9, 2025 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BaggageBuilder example is not correct

4 participants